package cn.iocoder.yudao.module.member.job.order;

import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.member.service.shunfengcheorder.ShunfengcheOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 取消超时订单
 */
@Component
@TenantJob
@Slf4j
public class CancelOrderJob implements JobHandler {

    @Resource
    private ShunfengcheOrderService shunfengcheOrderService;

    @Override
    public String execute(String param) {
        int count = shunfengcheOrderService.cancelTimeOutOrder();
        return String.format("执行取消超时订单 %s 个", count);
    }

}
